<?php

if (!isset($_REQUEST["invoiceid"])) { print "<strong>Error:</strong> You cannot access this file directly."; exit; }

require_once($_SERVER["DOCUMENT_ROOT"] . "/../sys/libs/init.lib");
require_once($_SERVER["DOCUMENT_ROOT"] . "/../sys/libs/invoice.lib");

$id = $_REQUEST["invoiceid"];

$inv = new invoice($db, $id, TRUE);

$invoice = $inv->invoice;
$items = $inv->items;
$payments = $inv->payments;

$smarty->assign("BILL_TO", $invoice->billTo);
$smarty->assign("ITEMS", $items);
$smarty->display("client_viewinvoice.tpl");

?>
